﻿<Window x:Class="GraphDrawing.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Draw Graph" Width="1000" Height="700" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" WindowStartupLocation="CenterScreen">
    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="drawingArea" Background="#FF83A7F9" Margin="0,168,0,0" PreviewMouseMove="DrawingAreaPreviewMouseMove" PreviewMouseRightButtonDown="DrawingAreaPreviewMouseRightButtonDown" PreviewMouseLeftButtonDown="DrawingAreaPreviewMouseLeftButtonDown"></Canvas>
        <TabControl Name="tabControl1" Margin="0,0,-3,492" Padding="0" HorizontalAlignment="Right" Width="995">
            <TabControl.BorderBrush>
                <SolidColorBrush Color="#FFACACAC" Opacity="0"/>
            </TabControl.BorderBrush>
            <TabItem Header="Graph" Name="tabItem1">
                    <Grid OpacityMask="{x:Null}" Canvas.Left="254" Canvas.Top="36">
                        <Grid.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="White" Offset="0" />
                                <GradientStop Color="#FF83A7F9" Offset="1" />
                                <!--<GradientStop Color="White" Offset="1" />-->
                            </LinearGradientBrush>
                        </Grid.Background>
                        <Rectangle Height="62" HorizontalAlignment="Left" Margin="337,10,0,0" Name="rectangle1" Stroke="#64000000" VerticalAlignment="Top" Width="2" />
                    <CheckBox Height="28" x:Name="isDisplayPositions" FlowDirection="LeftToRight" IsThreeState="False" Width="414" Content="Display possitions of vertices and edges" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" FontWeight="Normal" FontSize="17" Margin="345,10,217,109" />
                    <CheckBox Height="28" x:Name="isDisplayLines" FlowDirection="LeftToRight" IsThreeState="False" Width="414" Content="Display edges" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" FontWeight="Normal" FontSize="17" IsChecked="True" Margin="345,44,217,75" />
                    <Label Content="P = " Height="28" Name="label2" Width="26" Margin="35,31,915,88" />
                    <Button Content="SOLVE" Height="35" x:Name="solveGraph" Width="203" FontWeight="Bold" Click="SolveGraphClick" Margin="128,85,645,27" />
                    <Button Content="DRAW" Width="210" x:Name="startDrawGraph" Height="35" Click="StartDrawGraphClick" Margin="345,85,421,27" />
                    <Label Content="Number of vertices" Name="label1" Width="124" Margin="35,10,817,111" />
                    <TextBox x:Name="numbersOfEdges" Height="23" Width="41" TabIndex="1" Text="6" PreviewTextInput="NumbersOfEdgesPreviewTextInput" MaxLength="3" MaxLines="1" HorizontalContentAlignment="Right" Margin="146,12,789,112" />
                    <Label Content="Use only numbers !" Height="28" x:Name="error1" FontWeight="Bold" Foreground="Red" Visibility="Visible" Width="146" Margin="193,7,637,112" />
                    <TextBox Height="23" x:Name="pBox" Width="120" PreviewTextInput="PBoxPreviewTextInput" Text="0,5" TextAlignment="Right" Margin="67,36,789,88" />
                    <Label Content="P must be [0:1] !" FontWeight="Bold" Foreground="Red" Height="28" x:Name="error2" Visibility="Visible" Width="118" Margin="193,31,665,88" />
                </Grid>
            </TabItem>
            <TabItem Header="Trees" Name="tabItem2">
                <Grid OpacityMask="{x:Null}" Canvas.Left="254" Canvas.Top="36">
                    <Grid.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="White" Offset="0" />
                            <GradientStop Color="#FF83A7F9" Offset="1" />
                            <!--<GradientStop Color="White" Offset="1" />-->
                        </LinearGradientBrush>
                    </Grid.Background>
                    <Button Content="Solve trees" Height="52" HorizontalAlignment="Left" Margin="6,52,0,0" Name="drawTrees" VerticalAlignment="Top" Width="180" Click="DrawTreesClick" FontSize="16" FontWeight="Bold" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
                    <Button Content="&lt;" Height="52" HorizontalAlignment="Right" Margin="0,52,589,0" x:Name="backTreeButton" VerticalAlignment="Top" Width="85" FontWeight="Bold" FontSize="24" FontStretch="Normal" Click="BackTreeButtonClick" />
                    <Button Content="&gt;" FontSize="24" FontStretch="Normal" FontWeight="Bold" Height="52" HorizontalAlignment="Left" Margin="649,52,0,0" x:Name="nextTreeButton" VerticalAlignment="Top" Width="85" Click="NextTreeButtonClick" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
                    <Label Content="NO TREES !" Height="52" HorizontalAlignment="Left" Margin="393,52,0,0" x:Name="labelNumberOfTrees" VerticalAlignment="Top" Width="250" FontSize="24" FontWeight="Bold" HorizontalContentAlignment="Center"/>
                </Grid>
                
            </TabItem>
            <TabItem Header="Save" Name="tabItem3">
                <Grid OpacityMask="{x:Null}" Canvas.Left="254" Canvas.Top="36">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="144" />
                        <ColumnDefinition Width="832" />
                    </Grid.ColumnDefinitions>
                    <Grid.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="White" Offset="0" />
                            <GradientStop Color="#FF83A7F9" Offset="1" />
                            <!--<GradientStop Color="White" Offset="1" />-->
                        </LinearGradientBrush>
                    </Grid.Background>
                    <Button Content="Save as XML" Height="32" HorizontalAlignment="Left" Margin="9,9,0,0" x:Name="saveAsXMLButton" VerticalAlignment="Top" Width="210" Click="SaveAsXMLButtonClick" Grid.ColumnSpan="2" />
                    <Button Content="Import from XML" Height="32" HorizontalAlignment="Left" Margin="81,9,0,0" x:Name="importFromXMLButton" VerticalAlignment="Top" Width="210" Click="ImportFromXMLButtonClick" Grid.Column="1" />
                </Grid>
            </TabItem>
            <TabItem Header="Log" Name="tabItem4">
                <Grid OpacityMask="{x:Null}" Canvas.Left="254" Canvas.Top="36" Width="Auto" Margin="0,0,-1,0">

                    <Label HorizontalAlignment="Left" Margin="12,33,0,0" x:Name="labelNumberOfMaxEdges" Height="28" VerticalAlignment="Top" />
                    <Label HorizontalAlignment="Left" Margin="12,54,0,0" x:Name="labelNubmerOfEdges" Height="28" VerticalAlignment="Top" />
                    <Label Height="28" HorizontalAlignment="Left" Margin="12,77,0,0" x:Name="labelNumberOfInconsistentGraphs" VerticalAlignment="Top" Padding="5" />

                    <TextBox x:Name="logBox" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" BorderBrush="{x:Null}" IsReadOnly="True" Grid.Column="1" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalAlignment="Right" VerticalAlignment="Stretch">
                        <TextBox.ContextMenu>
                            <ContextMenu Background="White">
                                <MenuItem Command="ApplicationCommands.Copy" />
                                <MenuItem Header="Save as *.txt" Click="MenuItemClick" />
                                <MenuItem Header="Clear logs" ToolTip="Clear the log window" Click="MenuItemClearClick" />
                            </ContextMenu>
                        </TextBox.ContextMenu>
                        <TextBox.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="White" Offset="0" />
                                <GradientStop Color="#FF83A7F9" Offset="1" />
                                <!--<GradientStop Color="White" Offset="1" />-->
                            </LinearGradientBrush>
                        </TextBox.Background>
                    </TextBox>

                    <Grid.Background>
                       
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="White" Offset="0" />
                            <GradientStop Color="#FF83A7F9" Offset="1" />
                            <!--<GradientStop Color="White" Offset="1" />-->
                        </LinearGradientBrush>
                    </Grid.Background>
                </Grid>
            </TabItem>
            <TabItem Header="Isomorphism" HorizontalAlignment="Left" Height="20" VerticalAlignment="Top" Width="87" Margin="0">
                <Grid>
                <Grid.Background>

                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="White" Offset="0" />
                        <GradientStop Color="#FF83A7F9" Offset="1" />
                        <!--<GradientStop Color="White" Offset="1" />-->
                    </LinearGradientBrush>
                </Grid.Background>
                    <Button x:Name="ButtonIsomorphism" Content="Isomorphism" HorizontalAlignment="Left" Margin="50,50,0,0" VerticalAlignment="Top" Width="127" Height="51" FontWeight="Bold" FontSize="14" Click="ButtonIsomorphismClick"/>
                    <Button x:Name="ButtonIsomorphismTree1" Content="1" HorizontalAlignment="Left" Margin="313,50,0,0" VerticalAlignment="Top" Width="76" Height="51" FontWeight="Bold" FontSize="16" Click="ButtonIsomorphismTree1Click"/>
                    <Button x:Name="ButtonIsomorphismTree2" Content="2" HorizontalAlignment="Left" Margin="479,50,0,0" VerticalAlignment="Top" Width="76" Height="51" FontWeight="Bold" FontSize="16" Click="ButtonIsomorphismTree2Click"/>
                </Grid>
            </TabItem>
        </TabControl>
        
    </Grid>
    
</Window>
